//
//  BasicInformationTableViewCell.m
//  ApexCardSDK_Demo_iOS
//
//  Created by 谭永明 on 16/9/24.
//  Copyright © 2016年 珠海艾派克科技股份有限公司. All rights reserved.
//

#import "BasicInformationTableViewCell.h"

@interface BasicInformationTableViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *cardNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *createTimeLabel;

@end

@implementation BasicInformationTableViewCell

-(void)setCard:(MCCard *)card {
    self.cardNameLabel.text = card.name;
    self.createTimeLabel.text = [self timeStringWithTime:card.createdTime];
}

/**
 *  时间戳转字符串  
 */
-(NSString *)timeStringWithTime:(NSInteger)time {
    NSTimeInterval timeInterval = (double)time;
    NSDate *detaildate = [NSDate dateWithTimeIntervalSince1970:timeInterval];
    
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"YYYY-MM-dd HH:mm"];
    
    return [dateFormatter stringFromDate: detaildate];
}

@end
